import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:health_manager/pages/index.dart';

import 'hm_router/adapter.dart';
import 'hm_router/hm_navigator.dart';
import 'names.dart';

/// 路由页面
class RoutePages extends RoutesAdaptor {
  /// 注册路由
  @override
  registerRoutes(HMNavigator navigator) {}

  /// 当前模块所有路由
  @override
  List<RouteBase> allRoutes({GlobalKey<NavigatorState>? navigatorKey}) => [
        GoRoute(
          name: RouteNames.home,
          path: RouteNames.home,
          builder: (context, state) => const HomePage(),
        ),
        GoRoute(
          name: RouteNames.mine,
          path: RouteNames.mine,
          builder: (context, state) => const MinePage(),
        ),
        GoRoute(
          name: RouteNames.device,
          path: RouteNames.device,
          builder: (context, state) => const DevicePage(),
        ),
        GoRoute(
          name: RouteNames.service,
          path: RouteNames.service,
          builder: (context, state) => const ServicePage(),
        ),
        GoRoute(
          name: RouteNames.shop,
          path: RouteNames.shop,
          builder: (context, state) => const ShopPage(),
        ),
      ];
}
